<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <script type="text/javascript" src="js/vue-2.6.10.js"></script>
    <script type="text/javascript" src="js/axios.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        } 
        html {
            height: 100%;
        }
        body {
            height: 100%;
        }
        .container {
            height: 100%;
            background-image: linear-gradient(to right, #fbc2eb, #ffff00);
        }
        .login-wrapper {
            background-color: #fff;
            width: 358px;
            height: 588px;
            border-radius: 15px;
            padding: 0 50px;
            position: relative;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }
       .header {
           font-size: 38px;
           font-weight: bold;
           text-align: center;
           line-height: 200px;
       }
        .input-item {
            display: block;
            width: 100%;
            margin-bottom: 20px;
            border: 0;
            padding: 10px;
            border-bottom: 1px solid rgb(128, 125, 125);
            font-size: 15px;
            outline: none;
        }
        .input-item:placeholder {
            text-transform: uppercase;
        }
        .submit {
            text-align: center;
            padding: 10px;
            width: 100%;
            margin-top: 40px;
            background-image: linear-gradient(to right, #fbc2eb, #ffff00);
            color: #fff;   
            cursor: pointer;
        }
        .msg {
            text-align: center;
            line-height: 88px;
        }
        a {
            text-decoration-line: none;
            color: #abc1ee;
        }
    </style>
</head>
<body>
	
    <div class="container" id="login">
        <div class="login-wrapper">
            <div class="header">登录</div>
            <div class="form-wrapper">
                <input type="text" v-model="username" name="username" placeholder="请输入账号" class="input-item">
				<input type="text" v-model="password" name="password" placeholder="请输入密码" class="input-item">
				<div class="submit" v-on:click="login">登 录</div>
            </div>
            <div class="msg">
                没有账号?
                 <a href="register.html">注册</a>
            </div>
        </div>
    </div>	
    <script type="text/javascript">
    	let vue = new Vue({
    		el:'#login',
    		data:{
    			username:"",
    			password:"",
    			msg:""
    		},
    		created(){
    			
    		},methods:{
    			login:function(){
    				//let info =new FormData();
    				//info.append("username",vue.username);
    				//info.append("password",vue.password);
    				url = '/OrderServert/login.do?uId='+vue.username + '&uPassword=' +vue.password;
    				axios.post(url).then(
    						function(res_obj){
    							if(res_obj.data.code == 1){
    								window.location.href="home page.html";
    							}else{
    								
    								alert("账号或密码错误");
    							}
    						}
    						).catch(
    							function(){
    								alert("网络加载异常！！！");
    							}
    								)
    						
    			}
    		}
    	});
    </script>
</body>
</html>